package cn.bossx.org.service.impl;

import cn.bossx.basic.service.impl.BaseServiceImpl;
import cn.bossx.basic.util.PageList;
import cn.bossx.org.domain.SystemDictionaryDetail;
import cn.bossx.org.mapper.SystemDictionaryDetailMapper;
import cn.bossx.org.query.SystemDictionaryDetailQuery;
import cn.bossx.org.service.ISystemDictionaryDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SystemDictionaryDetailServiceImpl extends BaseServiceImpl<SystemDictionaryDetail> implements ISystemDictionaryDetailService {

    @Autowired
    private SystemDictionaryDetailMapper systemDictionaryDetailMapper;


    @Override
    public PageList<SystemDictionaryDetail> findDetailByTypeId(SystemDictionaryDetailQuery query) {

        Long total = systemDictionaryDetailMapper.findTotalByTypeId(query);
        List<SystemDictionaryDetail> list = systemDictionaryDetailMapper.findDetailByTypeId(query);

        PageList<SystemDictionaryDetail> pageList = new PageList<>(total,list);
        return pageList;
    }
}
